<template>
	<view class="content">

		<table>
			<tr>
				<td>ID</td>
				<td>店铺名称</td>
				<td>门店店长</td>
				<td>门店地址</td>
				<td>详细地址</td>
				<td>操作</td>
			</tr>

			<tr v-for="v in list">
				<td>{{v.ID}}</td>
				<td>{{v.StoreName}}</td>
				<td>{{v.StoreManager}}</td>
				<td>{{v.StoreAddress}}</td>
				<td>{{v.ShowAddress}}</td>
				<td><button @click="update(v.ID)">修改</button></td>
			</tr>
		</table>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			}
		},
		onLoad() {
			this.get_data()
		},
		methods: {
			get_data() {
				uni.request({
					url: 'http://127.0.0.1:8080/list', //仅为示例，并非真实接口地址。
					data: {},
					method: "GET",
					success: (res) => {
						console.log(res.data)
						this.list = res.data.Data
					}
				});
			},
			update(id){
				uni.navigateTo({
					url:"/pages/update/update?id="+id
				})
			},


		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>